package cz.incad.psh.pshassign.client.json;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;

/**
 *
 * @author alberto
 */
public class SearchData extends JavaScriptObject {

      // Overlay types always have protected, zero-arg ctors
      protected SearchData() { }

      // Typically, methods on overlay types are JSNI
      public final native JsArray<Facet> getFacets() /*-{ return this.facets; }-*/;
      public final native JsArray<ResultDoc> getResults()  /*-{ return this.response.docs;  }-*/;
      public final native int getNumDocs()  /*-{ return this.response.numFound;  }-*/;
      public final native ResultHl getHl(String uri)  /*-{ return this.highlighting[uri];  }-*/;
      public final native JavaScriptObject getHighlighting()  /*-{ return this.highlighting;  }-*/;
      public final native String getError()  /*-{ return this.error;  }-*/;
      
      public static native SearchData parseJson(String jsonStr)  /*-{ eval('var res = ' + jsonStr); return res;  }-*/;

    }
